<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/12/11
 * Time: 16:24
 */
include "config.php";
if(isset($_REQUEST["u_id"])){
    $UID=$_REQUEST["u_id"];
    $sql="SELECT *FROM carts WHERE u_id=?";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("i",$UID);
    $stmt->execute();
    $res=$stmt->get_result();
    $listArr=array();
    while ($row=$res->fetch_assoc()){
        array_push($listArr,$row);
    }
    print_r(json_encode($listArr));
}